Is there a way to minimize redundant parentheses for filters created with DXL?
void makeAFilter(string fullModuleString, string viewName, Filter myFilter) {
Module m = edit(fullModuleString, true);
set(m, myFilter);
save(m, view(viewName));
}
void testMakeFilter() {
Module m = current Module;
string targetModuleFullName = fullName(m) "_test"
Filter myFilter = (attribute "Absolute Number" > "1") //-
&& (attribute "Absolute Number" > "5000") //-
&& (attribute "Absolute Number" > "3") //-
&& (attribute "Absolute Number" > "4") //-
&& (attribute "Absolute Number" > "5") ;
makeAFilter(targetModuleFullName, "myEvalView7", myFilter);
// Call it:
testMakeFilter();
( -- BEGIN group 1
( -- BEGIN group 1.1
( -- BEGIN group 1.1.1
(Absolute Number > 1)
AND
(Absolute Number > 5000)
) -- END group 1.1.1
AND
(Absolute Number > 3)
) -- END group 1.1
AND
(Absolute Number > 4)
) -- END -- group 1
AND
(Absolute Number > 5)
( -- BEGIN Group 1
( -- BEGIN Group 1.1
( -- BEGIN Group 1.1.1
cond1
AND
cond2
) -- END Group 1.1.1
AND
cond3
) -- BEGIN Group 1.1
AND
cond4
) -- END Group 1
AND
cond5
SystemAdmin - Wed May 26 13:00:40 EDT 2010 |
Re: Minimizing redundant parentheses for filters? Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS |
Re: Minimizing redundant parentheses for filters? Mathias Mamsch - Wed May 26 14:59:16 EDT 2010 Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS The good news is I can still get the job done. The bad news is filters are a bit harder than SQL to verify correctness by visual inspection. |
Re: Minimizing redundant parentheses for filters? SystemAdmin - Thu May 27 09:32:57 EDT 2010 Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS |
Re: Minimizing redundant parentheses for filters? Mathias Mamsch - Thu May 27 09:46:46 EDT 2010 Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS |